package it.binario01.rpc;

import java.net.URL;
import java.util.*;
import org.apache.xmlrpc.*;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

public class TestClient {
		
	static String pathserver 	= "192.168.0.126";
	static String port			= "8080";
		
	public static void main (String [] args) {
		try {
		     
			XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		    config.setServerURL(new URL("http://" + pathserver + ":" + port + "/xmlrpc/xmlrpc"));
		    XmlRpcClient client = new XmlRpcClient(); 
		    client.setConfig(config);
		 
		    Object[] params = new Object[]{new String("ciao"), new String("ciao2")};
		    String result = (String) client.execute("rpc.inBound", params);
		
		    System.out.println("The sum is: "+ result);
	
		} catch (Exception exception) {
		   System.err.println("JavaClient: " + exception);
		}//catch
	   
	}//main
 
}//TestClient